package com.example.leetcode.trainingcamp.week1.practice1;

public class Test1108 {

    public String defangIPaddr(String address) {
        StringBuilder sb = new StringBuilder();
        for (int i =0;i<address.length();i++){
            if (address.charAt(i) != '.' ){
                sb.append(address.charAt(i));
            }else {
                sb.append("[.]");
            }
        }
        return sb.toString();
    }
}


class Demo1108{
  public static void main(String[] args) {
    String address = "1.1.1.1";
    Test1108 test1108 = new Test1108();
    String s = test1108.defangIPaddr(address);
    System.out.println(s);
  }
}